#include<iostream>
using namespace std;

int main (){
	int h=7;
	int m=50;
	
	int hh;
	int mm;
	
	int s;
	int v;
	
	cin>>s;
	cin>>v;
	
	int t=s/v;
	if(s%v!=0){
		t++;
	}
	
	hh=t/60;
	mm=t%60;
	m=m-mm;
	if(m<0)
	{
		m+=60;
		hh++; 
	}
	
	h=h-hh;
	
	if(h<0)
	h=h+24;
	
	if(h<10){
		cout<<0;
	}
	cout<<h<<":";
	if(m<10){
		cout<<0;
	}
	cout<<m<<endl;
	
	return 0;
} 
